#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
        unordered_map<int, int> hash;
        vector<int> ret;
        for (auto& e : nums1)
        {
            hash[e] = 1;
        }
        for (auto& e : nums2)
        {
            if (hash[e] > 0)
            {
                hash[e] = 0;
                ret.push_back(e);
            }

        }
        return ret;
    }
};